package program

import org.springframework.cloud.contract.spec.Contract

Contract.make {
    request {
        method 'POST'
        url value(consumer(regex('/api/programs/\\d+/tutors')),
                producer('/api/programs/1/tutors'))
        headers {
            contentType(applicationJsonUtf8())
            header('id', 1)
        }
        body("""
            [1,2,3]
        """)
    }
    response {
        status 201
        body("""
            [1,2,3]
        """)
        bodyMatchers {
            jsonPath('$.[*]', byType())
        }
        headers {
            contentType(applicationJsonUtf8())
        }
    }

}

